import { addParamsType, prefixUT } from '@/services/subject';
import request from '@/utils/request';
import { prefix } from '@/utils/utils';

const prefixU = prefix('subject');

export async function addSubject(params: addParamsType) {
  return request<prefixUT['add']>(prefixU('add'), {
    method: 'POST',
    data: params,
  });
}

export async function getSubject(opt) {
  return request<prefixUT['get']>(prefixU('get'), {
    method: 'POST',
    data: opt,
  });
}

export async function delSubject(opt) {
  return request<prefixUT['delete']>(prefixU('delete'), {
    method: 'POST',
    data: opt,
  });
}

export async function getEnum(params?) {
  return request<prefixUT['getEnum']>(prefixU('getEnum'), {
    method: 'POST',
    data: params,
  });
}
